<template>
    <div>
    </div>
</template>

<script>
    export default {
        data() {
            return {
              msg:'hello'
            }
        },
        created() {

        },
        mounted(){
            this.init()
        },
        methods:{
          init(){
            /*调用原生底部栏 */
            let NVTabBar = api.require('NVTabBar');
            NVTabBar.open({
                    styles: {
                    bg: '#fff',
                    h: 60,
                    dividingLine: {
                        width: 0.5,
                        color: '#000'
                    },
                    badge: {
                        bgColor: '#ff0',
                        numColor: '#fff',
                        size: 6.0,
                        centerX: 40,
                        centerY: 6
                    }
                },
                items: [{
                    w: api.winWidth / 3,
                    bg: {
                        marginB: api.systemType=='ios'?-10:-2,
                        image: 'rgba(0,0,0,0)'
                    },
                    iconRect: {
                        w: 30.0,
                        h: 30.0,
                    },
                    icon: {
                        normal: 'widget://res/images/home.png',
                        highlight:'widget://res/images/home-h.png',
                        selected:'widget://res/images/home-h.png',
                    },
                    title: {
                        text: '主页',
                        size: 12.0,
                        normal: '#696969',
                        selected: '#eb4f38',
                        marginB: 0
                    }
                }, {
                    w: api.winWidth / 3,
                    bg: {
                        marginB:api.systemType=='ios'?-10:0,
                        image: 'rgba(0,0,0,0)' //中间背景图
                    },
                    iconRect: {
                        w: 30,
                        h: 30,
                    },
                    icon: {
                        normal: 'widget://res/images/wallet.png',
                        highlight: 'widget://res/images/wallet-h.png',
                        selected: 'widget://res/images/wallet-h.png'
                    },
                    title: {
                        text : '投资',
                        size: 12.0,
                        normal: '#696969',
                        selected: '#eb4f38',
                        marginB: 0
                    }
                },{
                    w: api.winWidth / 3,
                    bg: {
                        marginB: api.systemType=='ios'?-10:0,
                        image: 'rgba(0,0,0,0)'
                    },
                    iconRect: {
                        w: 30.0,
                        h: 30.0,
                    },
                    icon: {
                        normal: 'widget://res/images/user.png',
                        highlight:'widget://res/images/user-h.png',
                        selected:'widget://res/images/user-h.png',
                    },
                    title: {
                        text: '我的',
                        size: 12.0,
                        normal: '#696969',
                        selected: '#eb4f38',
                        marginB: 0
                    }
                }],
                selectedIndex: 0
            },function(ret,err){
                let index = ret.index;
                api.setFrameGroupIndex({
                    name: 'index',
                    index: index
                });
            })

            //创建frames数组
            let frames = [];
            for (let i = 0,len = 3; i < len; i++) {
              frames.push( {
                  name: 'frame'+i,
                  url: 'frame'+i+'.html',
                  bgColor : 'rgba(0,0,0,0)',
                  bounces:false
              } )
            }
            //打开主页3个frames
            api.openFrameGroup({
                name: 'index',
                scrollEnabled: false,
                rect: {
                    x: 0,
                    y: 0,
                    w: api.winWidth,
                    h: api.frameHeight-50
                },
                index: 0,
                frames: frames
            }, function (ret, err) {
                // var index = ret.index;
                // var eFootLis = $('#footer li');
                // var activeFootLi = $('#footer li.active');
                // $('#footer li.active').removeClass('active');
                // $(eFootLis[index]).addClass('active');
            });
          }
        }
    }
</script>
<style lang="scss" scoped>

</style>
